const HDWalletProvider = require('@truffle/hdwallet-provider');
const Web3 = require('web3');
const { interface, bytecode } = require('./compile');

const provider = new HDWalletProvider(
  '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
  // remember to change this to your own phrase!
  'http://127.0.0.1:8545'
  // remember to change this to your own endpoint!
);
const web3 = new Web3(provider);

console.log('bytecode ', bytecode);

console.log('interface ', JSON.parse(interface));
const info = async () => {
  const accounts = await web3.eth.getAccounts();

  console.log('has account ', accounts.length);

  provider.engine.stop();
};
info();
